package com.bcfrj.shop.controller;

import com.bcfrj.shop.utils.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
import java.util.UUID;

@RestController
@CrossOrigin
@RequestMapping("/file")
public class FileController {




    @PostMapping("/upload")
    public String upload(MultipartFile uploadFile, HttpServletRequest request) {
        return FileUtils.saveFile(uploadFile, request);
    }
}
